<template>
  <div>
    <money-warning ref="MoneyWarning" @update="listInform"/>
    <number-warning ref="NumberWarning" @update="listInform"/>
    <child-number-warning ref="ChildNumberWarning" @update="listInform" v-show="false"/>
  </div>
</template>

<script>
  import MoneyWarning from './money'
  import NumberWarning from './number'
  import ChildNumberWarning from './child_number'
  import {listInformApi} from "@/api/website/inform";

  export default {
    name: "Inform",
    components: {MoneyWarning, NumberWarning, ChildNumberWarning},
    mounted() {
      this.listInform()
    },
    methods: {
      listInform() {
        listInformApi().then(result => {
          let list = result.resultParam.informList;
          /*资金*/
          let MoneyWarning = this.$refs.MoneyWarning.form;
          MoneyWarning.money = list[0].money;
          MoneyWarning.content = list[0].content;
          /*单号*/
          let NumberWarning = this.$refs.NumberWarning.form;
          NumberWarning.money = list[1].money;
          NumberWarning.content = list[1].content;
          /*子单数*/
          let ChildNumberWarning = this.$refs.ChildNumberWarning.form;
          ChildNumberWarning.money = list[2].money;
          ChildNumberWarning.content = list[2].content;
        })
      }
    }
  }
</script>
